<?php
namespace V2;
class C_TypeStyle extends \ResourceClass
{
    public $isActive = true;
    public $remark = '个人';

    public function get(array $req, array $post, &$result)
    {
        if (!isset($req['uid'])) {
            return 'require user uid';
        }
        if (!isset($req['userType'])) {
            return 'require user type';
        }
        if (!isset($req['k']) || !isset($req['t'])) {
            return 'data error';
        }
        $user_cls = \Biz\UserHandler::getById($req['userType'], $req['uid']);
        $enterprise_id = $user_cls->getEnterpriseId();
        /* 授权验证*/
        if (\Biz\UserHandler::checkAuth($req['userType'], $req['uid'], $enterprise_id, $req['id'] . $req['t'] . $post['payload'], $req['k']) == false) {
            return 'data illegal';
        }
        $mine_style = 0;
        $new_message = 0;
        $new_version = 0;
        $new_style = 0;
        //
        $user_handler = new \Biz\CustomerFeedbackHandler();
        $new_feedback = $user_handler->getFeedbackStyleByUid($req['uid']);

        if ($new_feedback == 1 || $new_message == 1 || $new_version == 1 || $new_style == 1) {
            $mine_style = 1;
        }
        $result = array('mine_style' => $mine_style, 'index_style' => 0, 'shop_style' => 0, 'order_style' => 0);
    }
}